package com.gitee.huxing.course;

import cn.hutool.core.date.DateUtil;
import com.gitee.huxing.course.domain.module.AccountDO;
import com.gitee.huxing.course.service.AccountOrderService;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @Description:
 * @ProjectName: JavaCourse
 * @Package: com.gitee.huxing.course
 * @ClassName: DubboDemoProviderApplication
 * @Author: huxing
 * @DateTime: 2021-10-03 下午3:45
 */
@Slf4j
@MapperScan(basePackages = {"com.gitee.huxing.course.domain.dao"})
@SpringBootApplication
public class DubboProviderApplication implements CommandLineRunner {

    @Autowired
    AccountOrderService service;

    public static void main(String[] args) {
        SpringApplication.run(DubboProviderApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("dubbo服务端启动: {}", DateUtil.now());
        this.service.apply(new AccountDO("胡星", 1000L));
    }
}
